﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;

namespace Framework.Consul
{
    public class ConsulOption
    {
        public string Address { set; get; }
        public string ServiceName { set; get; }
        public string ServiceIP { set; get; }
        public int ServicePort { set; get; }
        public string ServiceHealthCheck { set; get; }
        private readonly IConfiguration configuration;

        public ConsulOption(IConfiguration configuration)
        {
            this.configuration = configuration;
            var section=configuration.GetSection("ConsulAddress");
            section.Bind(this);
            //section.Bind(ServiceName);
            //section.Bind(ServiceIP);
            //section.Bind(ServicePort);
            //section.Bind(ServiceHealthCheck);
        }
    }
}